package main

import "fmt"

func main()  {
	i := 100
	fmt.Println("i ", i) //100
	stillTest(i) //200
	fmt.Println("after i ", i) //100
	fmt.Println("------------")
	fmt.Println("i ", i) //100
	anotherStillTest(&i) //200
	fmt.Println("after i ", i) //200
	fmt.Println("------------")
	x := 1000
	fmt.Println("x ", x) //1000
	addressStillTest(&x) //0xc4323343　把x的地址赋值给v
	fmt.Println("after x ", x) //1000  所以v的值也变为456
}
func stillTest(v int) {
	v = v + 100
}
func anotherStillTest(v *int) {
	*v = *v + 100
}
func addressStillTest(v *int) {
	x := 456
	v = &x
	fmt.Println(*v,x)
}


//对于map集合的拷贝

//5.定义一个函数，接收一个切片作为参数


